package wm.samsung.main;

import android.app.Activity;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class inicioActivity extends Activity {
	/** Called when the activity is first created. */

	private Button botonIngresarApp;
	private boolean flagIngreso = false;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.inicio);
		botonIngresarApp = (Button) findViewById(R.id.ingresarapp);
		botonIngresarApp.setOnClickListener(new Button.OnClickListener() {
			public void onClick(View v) {
				if (flagIngreso) {
					Intent i = new Intent(getBaseContext(),
							ingresoActivity.class);
					startActivity(i);

				} else {
				Intent i = new Intent(getBaseContext(),
							registroActivity.class);
					startActivity(i);
					flagIngreso = true;
				}

			}
		});
	}

	@Override
	public void onConfigurationChanged(Configuration newConfig) {
		super.onConfigurationChanged(newConfig);
		// Checks the orientation of the screen
		if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
			Toast.makeText(this, "landscape", Toast.LENGTH_SHORT).show();
		} else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
			Toast.makeText(this, "portrait", Toast.LENGTH_SHORT).show();
		}

	}

}